package com.szd.qiongyou20.community.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by SZD on 2016/12/28.
 */

public class ViewPager_Adapter extends FragmentPagerAdapter {

    private List<Fragment> mList;
    private String[] Titles;

    public ViewPager_Adapter(FragmentManager fm, List<Fragment> list, String[] titles) {
        super(fm);
        mList = list;
        Titles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return Titles[position];
    }
}
